<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<body class="hold-transition skin-blue sidebar-mini">
<section class="content-header">
    <h1>查看产品结构</h1>
</section>
<section class="content">
    <form id="proStructForm" role="form"
          enctype="multipart/form-data">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-body">
                        <h4>项目信息</h4>
                        <div class="row">
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>项目编号：</label><label th:text="${proJect.proCode}"></label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>项目名称：</label><label th:text="${proJect.proName}"></label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>数量：</label><label th:text="${proJect.proNum}"></label>
                                </div>
                            </div>
                            <div class="col-md-3">
                                <div class="form-group">
                                    <label>需方：</label><label th:text="${proJect.demander}"></label>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="form-inline">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label th:text="'分配科室：'+${proJect.depts}"></label>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <h4>产品结构</h4>
                        <div class="row">
                            <table id="bootstrap-table"></table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <input id="proId" type="hidden" th:value="${proJect.id}" name="proId">
        <input id="createCode" type="hidden" th:value="${createCode}" name="createCode">
    </form>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">

    var table;

    $(function () {

        /** 产品结构列表 */
        table = js.table.init({
            url: ctx + "designTask/proStruct/proStructList",
            pagination: false,
            queryData: {proId: $("#proId").val(), createCode: $("#createCode").val()},
            columns: [
                {
                    title: '序号', field: 'id', width: '50',
                    formatter: function (value, row, index) {
                        return index + 1;
                    }
                },
                {title: "类型", field: 'special'},
                {title: "产品结构名称", field: 'proPart'},
                {title: "创建人", field: 'createName'},
                {title: "创建时间", field: 'createTime'},
                {
                    title: "提交状态", field: 'status',
                    formatter: function (value) {
                        if (value === 1) {
                            return '<span class="badge label-inverse">未提交</span>';
                        } else if (value === 2) {
                            return '<span class="badge label-success">已提交</span>';
                        }
                    }
                }
            ]
        });

    });


</script>
</body>
</html>
